package com.hm.service.config.constant;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;

@Configuration
public class ServiceNameConfig {
    private static final Logger logger = LoggerFactory.getLogger(ServiceNameConfig.class);

    @Bean(name = {"ServiceNameTypeMap"})
    public HashMap<String, String> serviceNameTypeMap() {
        logger.warn("=======>serviceNameTypeMap初始化了<=======");
        return new HashMap<>() {
            {
                put("000_000_000", "0");//session接口
                //不需要token的接口
                put("000_000_002", "1");//登录接口（获取token）
                put("000_000_003", "1");//获取验证码接口
                put("000_000_006", "1");//获取二维码接口（测试阶段）
                put("003_000_000", "1");//获取微信公众号唯一标识openid
                put("003_000_001", "1");//获取微信js验证配置
                put("003_000_002", "1");//逆地理编码
                put("003_000_003", "1");//案件提交
                //需要token的接口
                put("000_000_001", "2");
                put("000_000_004", "2");
                put("000_000_005", "2");
                put("000_000_007", "2");
                put("000_000_008", "2");
                put("000_000_009", "2");
                put("000_000_010", "2");
                //停用的接口
                put("000_000_100", "-1");
            }
        };
    }

    @Bean(name = {"RequestLockMap"})
    public HashMap<String, String> requestLockMap() {
        logger.warn("=======>requestLockMap初始化了<=======");
        return new HashMap<>() {
            {
                //需要接口防抖
                put("000_000_007", "3");
                put("000_000_008", "3");
                put("000_000_009", "3");
                put("000_000_010", "3");
            }
        };
    }
}
